package lexer

// TokenType 词法单元的类型
type TokenType string

// 定义一些词法单元类型
var (
	// 特殊标记
	EOF TokenType = "EOF"

	// 关键字
	SELECT    TokenType = "SELECT"
	FROM      TokenType = "FROM"
	WHERE     TokenType = "WHERE"
	CREATE    TokenType = "CREATE"
	TABLE     TokenType = "TABLE"
	INSERT    TokenType = "INSERT"
	INTO      TokenType = "INTO"
	VALUES    TokenType = "VALUES"
	UPDATE    TokenType = "UPDATE"
	SET       TokenType = "SET"
	DELETE    TokenType = "DELETE"
	DROP      TokenType = "DROP"
	PRIMARY   TokenType = "PRIMARY"
	KEY       TokenType = "KEY"
	LIKE      TokenType = "LIKE"
	BETWEEN   TokenType = "BETWEEN"
	AND       TokenType = "AND"
	DEFAULT   TokenType = "DEFAULT"
	GROUP     TokenType = "GROUP"
	BY        TokenType = "BY"
	ORDER     TokenType = "ORDER"
	ASC       TokenType = "ASC"
	DESC      TokenType = "DESC"
	DATABASE  TokenType = "DATABASE"
	DATABASES TokenType = "DATABASES"
	SHOW      TokenType = "SHOW"
	USE       TokenType = "USE"
	TABLES    TokenType = "TABLES"
	INNER     TokenType = "INNER"
	LEFT      TokenType = "LEFT"
	RIGHT     TokenType = "RIGHT"
	JOIN      TokenType = "JOIN"
	ON        TokenType = "ON"

	// 标识符和字面量
	IDENT    TokenType = "IDENT" // 标识符（如列名、表名、函数名）
	INT      TokenType = "INT"   // 整数型
	TEXT     TokenType = "TEXT"
	STRING   TokenType = "STRING" // 字符串字面量
	FLOAT    TokenType = "FLOAT"
	DATETIME TokenType = "DATETIME" // 时间字面量（如'2023-12-12 12:34:56'）

	// 运算符
	EQ  TokenType = "="
	GT  TokenType = ">"
	LT  TokenType = "<"
	GTE TokenType = ">="
	LTE TokenType = "<="
	NEQ TokenType = "!="

	// 工具符
	COMMA    TokenType = ","
	SEMI     TokenType = ";"
	LPAREN   TokenType = "("
	RPAREN   TokenType = ")"
	ASTERISK TokenType = "*"
	COMMENT  TokenType = "#"
	DOT      TokenType = "." // 点操作符，用于 表名.列名
)
